<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>滚轮取值效果 -http://www.jb51.net/</title>
	</head>

	<body>
		<p>
			<label for="wheelDelta">滚动值:</label>(IE/Opera)
			<input type="text" id="wheelDelta" />
		</p>
		<p>
			<label for="detail">滚动值:(Firefox)</label>
			<input type="text" id="detail" />
		</p>
		<script type="text/javascript">
			var oTxt = document.getElementById("txt");
			/***********************
			 * 函数：判断滚轮滚动方向
			 * 作者：walkingp
			 * 参数：event
			 * 返回：滚轮方向 1：向上 -1：向下
			 *************************/
			object = (function() {
				//Private numbers
				return {
					//Public numbers
				}
			})();

			var scrollFunc = function(e) {
				e = e || window.event;
				if (e.wheelDelta) {//IE/Opera/Chrome
					console.log(e.wheelDelta);
				} else if (e.detail) {//Firefox
					console.log(e.detail);
				}
			}
			/*注册事件*/
			if (document.addEventListener) {
				document.addEventListener('DOMMouseScroll', scrollFunc, false);
			}//W3C
			window.onmousewheel = document.onmousewheel = scrollFunc;
			//IE/Opera/Chrome
		</script>
	</body>
</html>
